package com.service.impl;

import com.constance.Code;
import com.entity.Book;
import com.exception.BusinessException;
import com.mapper.BookMapper;
import com.service.BookService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class BookServiceImpl implements BookService {

    @Autowired
    private BookMapper bookMapper;

    public Book selectById(Integer id) throws ArithmeticException{
        Book book = bookMapper.selectById(id);
        System.out.println(1/0);
//        System.out.println(book);
        return book;
    }

    @Override
    public Boolean test() throws BusinessException {
        throw new BusinessException(Code.BUSINESS_ERR,"业务层异常");
    }

}